<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>待入库列表</title>
    <link rel="shortcut icon" href="favicon.ico">
    <script src="../../res/js/comm.js"></script>
    <link href="../../res/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="../../res/plugins/select2/css/select2.min.css" rel="stylesheet">
    <script src="../../res/plugins/select2/js/select2.min.js"></script>
    <style> .select2-container--open {
        z-index: 10000000000
    }  </style>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="panel panel-info">
        <div class="panel-heading"><i class="fa fa-info-circle"></i>售后单列表</div>
        <div class="panel-body">
            <div class="ibox-query">
                <form id="queryOrderRefundStoForm" method="post" class="form-horizontal">
                    <input id='refundStatus' name="refundStatus" type="hidden" value='2'/>
                    <div class="form-group">
                        <label class="col-sm-1 control-label">顶级渠道</label>
                        <div class="col-sm-2" name="channelSelectsPluginsDiv"></div>

                        <label class="col-sm-1 control-label">订单编码</label>
                        <div class="col-sm-2"><input name="orderCode" class="form-control" type="text"></div>

                        <label class="col-sm-1 control-label">父订单编码</label>
                        <div class="col-sm-2">
                            <input name="parentOrderCode" class="form-control" type="text">
                        </div>

                        <label class="col-sm-1 control-label">第三方订单号</label>
                        <div class="col-sm-2"><input name="outTradeCode" class="form-control" type="text"></div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-1 control-label">配送方式</label>
                        <div class="col-sm-2" name="providerSelectsPluginsDiv"></div>

                        <label class="col-sm-1 control-label">收货人姓名</label>
                        <div class="col-sm-2"><input name="receiverName" class="form-control" type="text"></div>

                        <label class="col-sm-1 control-label">收货人电话</label>
                        <div class="col-sm-2"><input name="receiverPhone" class="form-control" type="text"></div>

                        <label class="col-sm-1 control-label">是否要发票</label>
                        <div class="col-sm-2">
                            <select name="needInvoice" class="form-control">
                                <option value="">--请选择--</option>
                                <option value="Y">需要发票</option>
                                <option value="N">不需要发票</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-1 control-label">下单开始时间</label>
                        <div class="col-sm-2">
                            <input class="layui-input" id='createStartTime' name="createStartTime" placeholder="下单开始时间" type="text" readonly>
                        </div>

                        <label class="col-sm-1 control-label">下单结束时间</label>
                        <div class="col-sm-2">
                            <input class="layui-input" id='createEndTime' name="createEndTime" placeholder="下单结束时间" type="text" readonly>
                        </div>

                       <!-- <label class="col-sm-1 control-label">收款方</label>-->
                        <!--<div class="col-sm-2">
                            <select name="payee" class="form-control">
                                <option value="">&#45;&#45;请选择&#45;&#45;</option>
                                <option value="PAYEE_YIFENG">益丰收款</option>
                                <option value="PAYEE_THIRD">三方渠道</option>
                            </select>
                        </div>-->
                        <label class="col-sm-1 control-label">小票号</label>
                        <div class="col-sm-2"><input name="ticketNum" class="form-control" type="text"></div>

                        <label class="col-sm-1 control-label">门店编码</label>
                        <div class="col-sm-2"><input name="warehouseCode" class="form-control" type="text"></div>
                        <div class="col-sm-6" style="text-align: right">
                            <button class="btn btn-info" onclick='$.openx.query()' type="button">
                                <i class="glyphicon glyphicon-search"></i> 查询
                            </button>
                            &nbsp;
                            <button class="btn btn-info" onclick="resetForm()" type="button">
                                <i class="glyphicon glyphicon-share-alt"></i> 重置
                            </button>
                        </div>

                    </div>
                    <!--<div class="form-group">
                        <div class="col-sm-offset-10 col-sm-2">
                            <button class="btn btn-info" onclick='$.openx.query()' type="button">
                                <i class="glyphicon glyphicon-search"></i> 查询
                            </button>
                            &nbsp;
                            <button class="btn btn-info" onclick="resetForm()" type="button">
                                <i class="glyphicon glyphicon-share-alt"></i> 重置
                            </button>
                        </div>
                    </div>-->

                    <div class="hr-line-dashed"></div>
                </form>
            </div>
            <div class="row row-lg">
                <div class="col-sm-12">
                    <table id="table" data-show-export="true">
                        <thead>
                        <tr>
                            <th data-align="center" visible="false" data-field="id"
                                data-formatter="$.openx.generatorId"> 序号
                            </th>
                            <th data-align="center" data-formatter="showOrderRefundDetailFormat">操作</th>
                            <th data-align="center" data-field="orderCode">订单号</th>
                            <th data-align="center" data-field="outTradeCode" data-formatter="formatCode">第三方订单号</th>
                            <th data-align="center" data-field="posCode" data-formatter="formatCode">pos编码</th>
                            <th data-align="center" data-field="orderStateStr">订单状态</th>
                            <th data-align="center" data-field="afterSaleTypeStr">售后类型</th>
                            <th data-align="center" data-field="ticketNum">小票号</th>
                            <th data-align="center" data-field="topChannelCode" data-formatter="topChannelFormat">顶级渠道
                            </th>
                            <th data-align="center" data-field="warehouseCode">发货仓库</th>
                            <th data-align="center" data-field="warehouseName">仓库名称</th>
                            <th data-align="center" data-field="processStateStr">处理状态</th>
                            <th data-align="center" data-field="needReceiveAmount">益丰实收金额</th>
                            <th data-align="center" data-field="createTime" data-formatter='createTimeFormat'>下单时间</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>

<!-- 订单详情-->
<script type="text/html" id="orderRefundStoDetailTpl">
    <div id="orderRefundDetailDiv" style="padding: 15px">

        <p>
            {{# if(d.isRefund === 'Y' && d.refunded === '2'){  }}
                <button type="button" class="btn btn-warning btn-xs" onclick="refundOrderStockConfirm('{{d.orderRefundList[0].refundCode}}')">退货入库</button>
                {{# if(d.isPickupFail === 'Y'){  }}
                    <button type="button" class="btn btn-warning btn-xs" disabled style="color: #fff;background-color: #ff0000;">取货失败售后单，请谨慎操作</button>
                {{# } }}
            {{# } }}

            {{# if(d.isShowNodeInfo === 'Y'){  }}
            <button type="button" class="btn btn-info btn-xs" onclick="queryRefundStoLogistics()">物流查询</button>
            {{# } }}
        </p>




        {{# if(d.refunded ==='0'){ }}
            <p style="text-align: right;">
                <span style="display: inline-block; background-color: #ffba6e; width: auto; border-radius: 5px;padding: 2px;">剩余处理时间00:30:00</span>
            </p>
        {{# } }}
        <table class="layui-table">
            <tbody>
            <tr>
                <td rowspan="4" class="layui-table-td-bg">订单信息:</td>
                <td class="layui-table-td-bg">渠道</td>
                <td class="text-center" width="150px"> {{d.channelName ? d.channelName :"" }}</td>
                <td class="layui-table-td-bg">订单号</td>
                <td class="text-center">{{d.orderCode ? d.orderCode :"" }}</td>
                <td class="layui-table-td-bg">父订单编码</td>
                <td class="text-center">{{d.parentOrderCode ? d.parentOrderCode :"" }}</td>
                <td class="layui-table-td-bg">第三方订单号</td>
                <td class="text-center">{{d.outTradeCode ? d.outTradeCode :"" }}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">POS单号</td>
                <td class="text-center">{{(d.posCode && d.posCode!='000000') ? d.posCode : ""}}</td>
                <td class="layui-table-td-bg">收款方</td>
                <td class="text-center">{{d.payee ? d.payee :"-" }}</td>
                <td class="layui-table-td-bg">商品总金额</td>
                <td class="text-center">{{d.goodsTotalAmount ? d.goodsTotalAmount :0 }}</td>
                <td class="layui-table-td-bg">益丰实收金额</td>
                <td class="text-center">{{d.needReceiveAmount ? d.needReceiveAmount :0 }}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">优惠总金额</td>
                <td class="text-center">{{d.preferentialTotalAmount ? d.preferentialTotalAmount :0 }}</td>
                <td class="layui-table-td-bg">第三方补贴金额</td>
                <td class="text-center">{{d.subsidyTotalAmount ? d.subsidyTotalAmount : 0 }}</td>
                <td class="layui-table-td-bg">用户实付金额</td>
                <td class="text-center">{{d.customerNeedPayAmount ? d.customerNeedPayAmount : 0 }}</td>
                <td class="layui-table-td-bg">下单时间</td>
                <td class="text-center">{{d.createTime ? d.createTime:""}}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">配送费用</td>
                <td class="text-center">{{d.deliveryAmount ? d.deliveryAmount :0}}</td>
                <td class="layui-table-td-bg">包装费</td>
                <td class="text-center">{{d.packingAmount?d.packingAmount: 0}}</td>
                <td class="layui-table-td-bg">收件人姓名</td>
                <td class="text-center">{{d.receiverName?d.receiverName:""}}</td>
                <td class="layui-table-td-bg">收件人电话</td>
                <td class="text-center">{{d.receiverPhone?d.receiverPhone:""}}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">售后单信息</td>
                <td class="layui-table-td-bg">售后单号</td>
                <td class="text-center">{{d.orderRefundList[0].refundCode ? d.orderRefundList[0].refundCode :"" }}</td>
                <td class="layui-table-td-bg">申请时间</td>
                <td class="text-center">{{d.orderRefundList[0].createTime ? d.orderRefundList[0].createTime:""}}</td>
                <td class="layui-table-td-bg">售后原因</td>
                <td class="text-center" colspan="3">{{d.orderRefundList[0].reason ? d.orderRefundList[0].reason:""}}</td>
            </tr>
            <tr>
                <td class="layui-table-td-bg">备注</td>
                <td class="text-center" colspan="8">{{d.orderRefundList[0].remark ? d.orderRefundList[0].remark : ""}}</td>
            </tr>
            <tr>
                <td rowspan="1" colspan="9" class="layui-table-td-bg">售后商品信息</td>
            </tr>
            <tr>
                <td colspan="9" style="padding: 4px;">
                    <table class="layui-table" style="text-align: center;margin: 0px">
                        <thead>
                        <tr>
                            <th style="text-align: center">商品图片</th>
                            <th style="text-align: center">商品编码</th>
                            <th style="text-align: center">商品名称</th>
                            <th style="text-align: center">UPC(69)码</th>
                            <th style="text-align: center">规格</th>
                            <th style="text-align: center">执行价</th>
                            <th style="text-align: center">记账价</th>
                            <th style="text-align: center">数量</th>
                            <th style="text-align: center">记账价合计(元)</th>
                        </tr>
                        </thead>
                        <tbody>
                        {{# layui.each(d.refundingGoodsList, function(index, item){ }}
                        <tr>
                            <td><img src="{{item.imgeUrl}}" width="40px" height="40px"></td>
                            <td> {{item.goodsCode}}</td>
                            <td>{{item.goodsName}}</td>
                            <td>{{item.mainBarcode?item.mainBarcode:"无"}}</td>
                            <td>{{item.standard ?item.standard:"无"}}</td>
                            <td>{{item.exercisePrice ? item.exercisePrice : 0}}</td>
                            <td>{{item.accountPrice ? item.accountPrice : 0}}</td>
                            <td>{{item.quantity ? item.quantity : 0}}</td>
                            <td>{{item.quantity ? Math.round(accMul(accMul(item.quantity , (item.accountPrice ?
                                item.accountPrice : 0)),100))/100 : 0}}
                            </td>
                        </tr>
                        {{# }); }}
                        </tbody>
                    </table>
                </td>
            </tr>
            <tr>
                <td rowspan="1" colspan="9" class="layui-table-td-bg">订单商品信息</td>
            </tr>
            <tr>
                <td colspan="9" style="padding: 4px;">
                    <table class="layui-table" style="text-align: center;margin: 0px">
                        <thead>
                        <tr>
                            <th style="text-align: center">商品图片</th>
                            <th style="text-align: center">商品编码</th>
                            <th style="text-align: center">商品名称</th>
                            <th style="text-align: center">UPC(69)码</th>
                            <th style="text-align: center">规格</th>
                            <th style="text-align: center">执行价</th>
                            <th style="text-align: center">记账价</th>
                            <th style="text-align: center">数量</th>
                            <th style="text-align: center">记账价合计(元)</th>
                        </tr>
                        </thead>
                        <tbody>
                        {{# layui.each(d.listGoods, function(index, item){ }}
                        <tr>
                            <td><img src="{{item.imgeUrl}}" width="40px" height="40px"></td>
                            <td> {{item.goodsCode}}</td>
                            <td>{{item.goodsName}}</td>
                            <td>{{item.mainBarcode?item.mainBarcode:"无"}}</td>
                            <td>{{item.standard ?item.standard:"无"}}</td>
                            <td>{{item.exercisePrice ? item.exercisePrice : 0}}</td>
                            <td>{{item.accountPrice ? item.accountPrice : 0}}</td>
                            <td>{{item.quantity ? item.quantity : 0}}</td>
                            <td>{{item.quantity ? Math.round(accMul(accMul(item.quantity , (item.accountPrice ?
                                item.accountPrice : 0)),100))/100 : 0}}
                            </td>
                        </tr>
                        {{# }); }}
                        </tbody>
                    </table>
                </td>
            </tr>
            {{# if(d.refunded ==='0'){ }}
            <tr>
                <td rowspan="1" colspan="9">
                    <div style="width: auto;text-align: center;">
                        <button type="button" class="btn btn-info" onclick ="javascript:agreeRefund('{{d.orderRefundList[0].refundCode}}')" style="width: 100px;margin: 0px 50px">同意,仅退款</button>
                        <button type="button" class="btn btn-info" onclick ="javascript:agreeNeedBack('{{d.orderRefundList[0].refundCode}}')" style="width: 100px;margin: 0px 50px">同意,退货退款</button>
                        <button type="button" class="btn btn-danger" onclick ="javascript:refuseRefund('{{d.orderRefundList[0].refundCode}}')" style="width: 100px;margin: 0px 50px">拒绝</button>
                    </div>
                </td>
            </tr>
            {{# } }}
            {{# if(d.refunded === '5'){ }}
            <tr>
                <td rowspan="1" colspan="9">
                    <div style="width: auto;text-align: center;">
                        <button type="button" class="btn btn-info" onclick ="javascript:agreeRefundForce('{{d.orderRefundList[0].refundCode}}')" style="width: 100px;margin: 0px 50px">同意,仅退款</button>
                        <button type="button" class="btn btn-info" onclick ="javascript:agreeNeedBackForce('{{d.orderRefundList[0].refundCode}}')" style="width: 100px;margin: 0px 50px">同意,退货退款</button>
                    </div>
                </td>
            </tr>
            {{# } }}
            </tbody>
        </table>
    </div>
</script>

<!-- 物流详情-->
<script type="text/html" id="refundStoLogisticsInfotpl">
    <div id="vertical-timeline" class="vertical-container dark-timeline">
        <div class="vertical-timeline-block" style="padding: 0px;margin-bottom: 10px;margin-top: 10px">
            <div class="vertical-timeline-icon navy-bg">
                <i class="fa fa-commenting-o"></i>
            </div>
            <div class="vertical-timeline-content" style="padding: 4px;">
                <p> &nbsp;<b>物流公司：{{d.logisticsName ? d.logisticsName:"无"}}</b> &nbsp; &nbsp;<b>运单号：{{d.waybillCode?d.waybillCode:"无"}}</b> &nbsp; &nbsp;<b>配送状态：{{d.deliveryStatusDesc?d.deliveryStatusDesc:"无"}}</b></p>
            </div>
        </div>
        {{# layui.each(d.traceInfos, function(index, item){ }}
        <div class="vertical-timeline-block" style="padding: 0px;margin-bottom:10px;margin-top: 10px">
            <div class="vertical-timeline-icon navy-bg">
                <i class="fa fa-truck"></i>
            </div>
            <div class="vertical-timeline-content" style="padding: 2px">
                <p style="margin-bottom: 1px;padding-bottom: 12px;"> {{item.nodeDesc ? item.nodeDesc:""}}   &nbsp;&nbsp;&nbsp;&nbsp;<b>{{item.nodeTime ? item.nodeTime :""}}  </b></p>
            </div>
        </div>
        {{# }); }}
    </div>
</script>

<!-- 退货入库-->
<script type="text/html" id="returnOrderStoFinalTpl">
    <div id="returnOrderFinalDiv" style="padding: 15px">
        <table class="layui-table" style="text-align: center;margin: 0px">
            <thead>
            <tr>
                <th style="text-align: center">商品图片</th>
                <th style="text-align: center">商品编码</th>
                <th style="text-align: center">商品名称</th>
                <th style="text-align: center">UPC(69)码</th>
                <th style="text-align: center">规格</th>
                <th style="text-align: center">执行价</th>
                <th style="text-align: center">记账价</th>
                <th style="text-align: center">退货数量</th>
                <th style="text-align: center">记账价合计(元)</th>
            </tr>
            </thead>
            <tbody>
            {{# layui.each(d.refundingGoodsList, function(index, item){ }}
            <tr>
                <td><img src="{{item.imgeUrl}}" width="40px" height="40px"></td>
                <td> {{item.goodsCode}}</td>
                <td>{{item.goodsName}}</td>
                <td>{{item.mainBarcode?item.mainBarcode:"无"}}</td>
                <td>{{item.standard ?item.standard:"无"}}</td>
                <td>{{item.exercisePrice ? item.exercisePrice : 0}}</td>
                <td>{{item.accountPrice ? item.accountPrice : 0}}</td>
                <td>{{item.quantity ? item.quantity : 0}}</td>
                <td>{{item.quantity ? Math.round(accMul(accMul(item.quantity , (item.accountPrice ?
                    item.accountPrice : 0)),100))/100 : 0}}
                </td>
            </tr>
            {{# }); }}
            <tr>
                <td colspan="9" style="text-align: right;">退款商品总价：{{d.refundAmount ? d.refundAmount : 0}}</td>
            </tr>
            <tr>
                <td>
                    是否退运费：
                </td>
                <td colspan="8" style="text-align: left;">
                    <input type="hidden" name="returnOderCode" value="{{d.orderCode}}" id="returnOderCode">
                    <input type="radio" name="isReturnFreight" id="returnFreight_0" value="true" {{d.refundOrder.isRefundFreight === 'Y' ? 'checked' : ''}} disabled="disabled"><label for="returnFreight_0">退运费</label>&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="radio" name="isReturnFreight" id="returnFreight_1" value="false" {{d.refundOrder.isRefundFreight === 'N' ? 'checked' : ''}} disabled="disabled"><label for="returnFreight_1">不退运费</label>
                </td>
            </tr>
            {{# if(d.refundOrder.processResult != ''){ }}
            <tr>
                <td>
                    确认结果：
                </td>
                <td colspan="8" style="text-align: left;">
                    {{d.refundOrder.processResult ? d.refundOrder.processResult : ''}}
                </td>
            </tr>
            {{# } }}
            <tr>
                <td>
                    顾客退货理由：
                </td>
                <td colspan="8" style="text-align: left;">
                    <textarea rows="5" cols="30" style="width: 100%;" id="returnReason" disabled="disabled">{{d.refundOrder.reason ? d.refundOrder.reason : ''}}</textarea>
            </tr>
            </tbody>
        </table>
    </div>
</script>



<script src="../../res/plugins/yifeng/lbsAreaSelect.js"></script>


<script type="text/javascript">
    (function () {
        $.openx.loadScript(['../../res/plugins/yifeng/partner.js', '../../res/plugins/yifeng/orderStatus.js', '../../res/plugins/iCheck/icheck.min.js', '../../res/plugins/yifeng/channelSelects.js', '../../js/order/refundStorage.js', '../../res/js/ajaxUtil.js', '../../res/plugins/yifeng/providerSelects.js']);
    })();
</script>
</html>